My task?

Make finalized map(s) in which I:

Do you want your maps to be static or interactive? What areas do you want to focus on? Do you want to show land use/landcover and watersheds in a single map or in separate maps? Just make sure that your final outputs are presented in a nice professional HTML that you’d be proud to share with someone so that they can see your awesome spatial code!

Let’s get cracking!

Read in data

water <- read_sf(here("Watersheds", "Watersheds.shp"))

Basically plot it

plot(water)

Unfortunately, swma (water management area) doesn’t look very interesting… “wuc” (watershed unit code text) and “huc” (watershed unit code numeric) also don’t look too interesting

Check on other map related things and map it!

st_crs(water) #cool, EPSG is 4326, as it should be
## Coordinate Reference System:
##   EPSG: 4326 
##   proj4string: "+proj=longlat +datum=WGS84 +no_defs"
#Rename variable of interest in the name of good-looking maps
water <- water %>% 
  mutate(`Watershed Area (sq m)`= hucarea)

water_map <- ggplot(data=water) +
  geom_sf(aes(fill=`Watershed Area (sq m)`, color=`Watershed Area (sq m)`), show.legend = FALSE) +
  scale_fill_paletteer_c("scico::hawaii", direction=-1) +
  scale_color_paletteer_c("scico::hawaii", direction=-1) +
  ggtitle("Map of the watersheds of the Hawaiian Islands") +
  xlab("Longitude") +
  ylab("Latitude") +
  theme(panel.grid.major = element_line(color = "gray"(0.5), linetype = "dashed", size = 0.5),
        panel.background = element_rect(fill = "aliceblue"))

ggplotly(water_map) %>%
  highlight(
    "plotly_hover",
    selected = attrs_selected(line = list(color = "black")))